
CREATE TABLE FLW_LIC_DATABASECHANGELOGLOCK (ID INTEGER NOT NULL, LOCKED SMALLINT NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DBCHGLOGLOCK PRIMARY KEY (ID));

DELETE FROM FLW_LIC_DATABASECHANGELOGLOCK;

INSERT INTO FLW_LIC_DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, 0);

UPDATE FLW_LIC_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.68.122 (192.168.68.122)', LOCKGRANTED = TIMESTAMP('2021-02-26 12:38:21.465') WHERE ID = 1 AND LOCKED = 0;

CREATE TABLE FLW_LIC_DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP NOT NULL, ORDEREXECUTED INTEGER NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10));

CREATE TABLE FLW_LIC_LICENSE (ID_ VARCHAR(255) NOT NULL, RESOURCE_BYTES_ BLOB, CREATION_TIME_ TIMESTAMP(6) NOT NULL, CONSTRAINT PK_FLW_LIC_LICENSE PRIMARY KEY (ID_));

INSERT INTO FLW_LIC_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1', 'flowable', 'com/flowable/license/db/liquibase/flowable-license-db-changelog.xml', CURRENT TIMESTAMP, 1, '8:dba591f53fdc1240cca7f4b078fdb885', 'createTable tableName=FLW_LIC_LICENSE', '', 'EXECUTED', NULL, NULL, '3.8.0', '4339502396');

CREATE TABLE FLW_LIC_USER_LOGIN (USER_ID_ VARCHAR(255) NOT NULL, TIMESTAMP_ TIMESTAMP(6) NOT NULL, APPLICATION_ VARCHAR(255) NOT NULL);

INSERT INTO FLW_LIC_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('2', 'flowable', 'com/flowable/license/db/liquibase/flowable-license-db-changelog.xml', CURRENT TIMESTAMP, 2, '8:db32ff5e89fd162412c175257e0aa8ef', 'createTable tableName=FLW_LIC_USER_LOGIN', '', 'EXECUTED', NULL, NULL, '3.8.0', '4339502396');

ALTER TABLE FLW_LIC_USER_LOGIN ADD TENANT_ID_ VARCHAR(255);

CALL SYSPROC.ADMIN_CMD ('REORG TABLE FLW_LIC_USER_LOGIN');

INSERT INTO FLW_LIC_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('3', 'flowable', 'com/flowable/license/db/liquibase/flowable-license-db-changelog.xml', CURRENT TIMESTAMP, 3, '8:840fd3ff13278fb466cebadcfabd8ced', 'addColumn tableName=FLW_LIC_USER_LOGIN', '', 'EXECUTED', NULL, NULL, '3.8.0', '4339502396');

UPDATE FLW_LIC_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE FLW_CTRL_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.68.122 (192.168.68.122)', LOCKGRANTED = TIMESTAMP('2021-02-26 12:38:26.995') WHERE ID = 1 AND LOCKED = 0;

UPDATE FLW_CTRL_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;

